<template>
  <v-card>
    <v-toolbar >
      <v-toolbar-title>员工自评</v-toolbar-title>
    </v-toolbar>

    <v-card-text>
      <v-textarea outlined label="员工个人述职及自我评价" v-model="answerForm.content1"></v-textarea>

      <v-divider class="my-2"></v-divider>

      <v-data-table :headers="answerItems" :items="answerDesserts" dense>
        <template v-slot:top>
          <v-toolbar flat>
            <v-toolbar-title>自我评价</v-toolbar-title>
          </v-toolbar>
        </template>
        <template v-slot:item.action="{item}">
          <v-radio-group row v-if="item.index==1" v-model="answerForm.content2">
            <v-radio label="很满意" value="很满意"></v-radio>
            <v-radio label="满意" value="满意"></v-radio>
            <v-radio label="还可以" value="还可以"></v-radio>
            <v-radio label="不满意" value="不满意"></v-radio>
          </v-radio-group>
          <v-radio-group row v-if="item.index==2"  v-model="answerForm.content3">
            <v-radio label="很能胜任" value="很能胜任"></v-radio>
            <v-radio label="基本胜任" value="基本胜任"></v-radio>
            <v-radio label="能力稍感不足" value="能力稍感不足"></v-radio>
            <v-radio label="能力明显不足" value="能力明显不足"></v-radio>
          </v-radio-group>
          <v-radio-group row v-if="item.index==3"  v-model="answerForm.content4">
            <v-radio label="很满意" value="很满意"></v-radio>
            <v-radio label="满意" value="满意"></v-radio>
            <v-radio label="还可以" value="还可以"></v-radio>
            <v-radio label="不满意" value="不满意"></v-radio>
          </v-radio-group>
          <v-radio-group row v-if="item.index==4"  v-model="answerForm.content5">
            <v-radio label="太大" value="太大"></v-radio>
            <v-radio label="大" value="大"></v-radio>
            <v-radio label="适中" value="适中"></v-radio>
            <v-radio label="太少" value="太少"></v-radio>
          </v-radio-group>
          <v-radio-group row v-if="item.index==5"  v-model="answerForm.content6">
            <v-radio label="很好" value="很好"></v-radio>
            <v-radio label="好" value="好"></v-radio>
            <v-radio label="合适" value="合适"></v-radio>
            <v-radio label="太少" value="太少"></v-radio>
          </v-radio-group>
        </template>
      </v-data-table>

      <v-textarea outlined  v-model="answerForm.content7" label="对部门或事务所的建议及个人要求："></v-textarea>
    </v-card-text>

    <v-divider></v-divider>

    <v-card-actions>
      <v-spacer></v-spacer>
       <v-btn class="white--text" color="green darken-1" depressed @click="saveAnswer">
                保存
                <v-icon right>mdi-content-save</v-icon>
              </v-btn>
    </v-card-actions>
  </v-card>
</template>

<script>
export default {
    data(){
        return {
             answerItems: [
                    {
                        text: "序号",
                        value: "index"
                    },
                    {
                        text: "评价项",
                        value: "title"
                    },
                    {
                        text: "选项",
                        value: "action"
                    }
                ],
                answerDesserts: [
                    { index: 1, title: "你对考核期的工作表现感到:" },
                    { index: 2, title: "你对目前工作岗位感到:" },
                    { index: 3, title: "你对与同事及领导间关系感到:" },
                    { index: 4, title: "你对目前的工作量感到:" },
                    { index: 5, title: "你对目前的待遇感到:" }
                ],
                answerForm:{

                }
        }
    },
    methods: {
        saveAnswer(){
            console.log(this.answerForm)
            this.axios.post('/aseWork/saveWorkSelf',this.answerForm)
            .then(res=>{
                
            })

            
        }
    },
}
</script>